<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main"/>
        <title>我的提问</title>
    </head>
    <body>
        <div class="body">
            <g:if test="${flash.message}">
                <div class="message">${flash.message}</div>
            </g:if>
            <div>
                <span><g:link class="create" action="create">新 提 问</g:link></span>
            </div>
            <div class="list"> 

                         <g:each in="${commentsInstanceList}" status="i" var="commentsInstance">
                            <div class="post">
                                <h2 class="title">
                                     我的提问：
                                </h2>
                                <div class="entry">
                                    ${commentsInstance.content.encodeAsHTML()}
                                </div>
                                <div class="meta">
                                     <p class="byline">
                                         提问于
                                         <g:formatDate format="yyyy-MM-dd" date="${commentsInstance.createTime}"/>
                                    </p>
                                    <%
                                    def remarkSize = Remark.countByComments(commentsInstance)
                                    %>
                                    
                                </div>
                            </div>

                            <div class="post"><h2 class="title">回复：</h2></div>
                            <g:if test = "${remarkSize > 0}">
                            <div id="postedComments">
                                 <g:each in="${Remark.findAllByComments(commentsInstance)}" status="j" var="remark">
                                    <div class="commentBg">
                                        <h4 class="commentTitle">
                                        </h4>
                                        <div class="commentByLine">
                                            ${remark?.teacherName.encodeAsHTML()} 评论于
                                            <g:formatDate format="yyyy-MM-dd" date="${remark?.createTime}"/>
                                             <g:formatDate format="h:mm" date="${remark?.createTime}"/>
                                             
                                        </div>
                                        <div class="commentContent">
                                            ${remark?.content.encodeAsHTML()}
                                        </div>
                                    </div>
                                    <div class="dots"></div>
                                </g:each>
                            </div>
                            </g:if>
                            <g:else>
                                    没有回复
                            </g:else>

                            <div id="commentSpinner" class="spinner" style="display:none;">
                                <img src="${createLinkTo(dir: 'images', file: 'spinner.gif')}" alt="Spinner"/>
                            </div>
                        </g:each>

            </div>
        </div>
    </body>
</html>
